package com.strange.mdl.module.mdl.dal.mysql.activity;

import java.util.*;

import com.strange.mdl.framework.common.pojo.PageResult;
import com.strange.mdl.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.strange.mdl.framework.mybatis.core.mapper.BaseMapperX;
import com.strange.mdl.module.mdl.dal.dataobject.activity.ActivityUserDO;
import org.apache.ibatis.annotations.Mapper;
import com.strange.mdl.module.mdl.controller.admin.activity.vo.*;

/**
 * 活动用户参与记录 Mapper
 *
 * @author 密谛灵总控
 */
@Mapper
public interface ActivityUserMapper extends BaseMapperX<ActivityUserDO> {

    default PageResult<ActivityUserDO> selectPage(ActivityUserPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ActivityUserDO>()
                .eqIfPresent(ActivityUserDO::getStatus, reqVO.getStatus())
                .betweenIfPresent(ActivityUserDO::getSignupTime, reqVO.getSignupTime())
                .betweenIfPresent(ActivityUserDO::getCancelTime, reqVO.getCancelTime())
                .eqIfPresent(ActivityUserDO::getCheckedIn, reqVO.getCheckedIn())
                .eqIfPresent(ActivityUserDO::getRole, reqVO.getRole()));
    }

}